﻿<script src="scripts/GridView.js"></script>
<section id="resultsPage">
    <form action="/">
        <p>
            В момента са налични <span data-bind='text: offers().length'>&nbsp;</span> оферти:
        </p>
        <table data-bind='visible: offers().length > 0' class="metrotable">
            <thead>
                <tr data-bind="foreach: columnNames">
                    <th class="k-header k-filterable" data-bind="text: $data, click: $root.sortColumn, css: { 'active': $root.currentItem() == $data }"></th>
                </tr>
            </thead>
            <tbody data-bind='foreach: offers'>
                <tr>
                    <td data-bind="text: driver.fname + ' ' + driver.lname + ' ' + driver.email + ' ' + driver.phone"></td>
                    <td data-bind="text: trip.from"></td>
                    <td data-bind="text: trip.to"></td>
                    <td data-bind="text: trip.dateOfDeparture"></td>
                    <td data-bind="text: price.value + ' ' + price.currency"></td>
                    <td>
                        <a class="k-button" href='#' data-bind='click: $root.removeOffer'><span class="k-icon k-i-close"></span></a>
                    </td>
                    <td>
                        <a class="k-button" href='#' data-bind='click: $root.printOffer'><span class="k-icon k-i-tick"></span></a>
                    </td>
                </tr>
            </tbody>
        </table>
    </form>
</section>
